{% extends "goflow/base_site.html" %}
{% load i18n admin_modify adminmedia %}

{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/admin/RelatedObjectLookups.js"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/calendar.js"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/admin/DateTimeShortcuts.js"></script>
{% endblock %}

{% block content %}

	{% block content_header %}
	<h1>Model edition</h1>
	This is a default form used by the generic application:
	<ul>
	<li>edit_model
	</ul>
	
	You may use a suitable form by setting the <i>form_class</i> parameter
	in the urls.py file as follows:
	<pre>
	    (r'^myedit/(?P<id>.*)/$', 'goflow.workflow.applications.edit_model', {'form_class':MyModelForm, template='my_template.html'}),
	</pre>
	You should provide a form as <a href=http://www.djangoproject.com/documentation/modelforms/ target=doc>documented here</a>,
	and inheriting of </i>goflow.runtime.forms.BaseForm</i>.
	<p>You may also define a suitable template (the default is <i>edit_model.html</i>) with the <i>template</i> parameter.
	This template can access the following variables:
	<ul>
	<li>form: displays the form
	<li>object: object (linked to the process instance, instance.wfobject())
	<li>submit_name: submit buttons name
	<li>ok_values: list of submit values (button labels) for OK
	<li>cancel_value: submit value for cancel button
	</ul>
	{% endblock %}


	{% block content_form %}
	
		{% if form.is_multipart %}
		<form enctype="multipart/form-data" method="post">
		{% else %}
		<form method="post">
		{% endif %}
			
			{% load apptools_lib %}
			{% form_ext form %}
		
			{% block buttons_form %}{% input_buttons %}{% endblock %}
		
		</form>
		
	{% endblock %}

{% endblock %}
